from base.base import Base
from appium import webdriver
from time import sleep
import logging
from selenium.webdriver.common.by import By
class Guanzhupage(Base):
    dianjiguanzhuanniu=(By.ID,'com.kongfz.app:id/lav_2')
    guanzhuanniu=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.view.ViewGroup/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ImageView')
    sandian = (By.XPATH,'new UiSelector(),resource-id("com.kongfz.app:id/tv_navigation")')
    quxiaoguanzhu = (By.XPATH,'//android.widget.TextView[@text="取消关注"]')
    sandian2=(By.ID,'com.kongfz.app:id/tv_navigation')
    dy=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.recyclerview.widget.RecyclerView/android.widget.TextView[3]')
    def guanzhugongneng(self):
        logging.info("开始测试执行")
        self.loc_ele(self.dianjiguanzhuanniu).click()
        sleep(2)
        self.loc_ele(self.guanzhuanniu).click()
        sleep(2)
        logging.info("输入搜索内容")
        self.loc_ui_ele(self.sandian).click()
        sleep(2)
        self.loc_wait_ele(self.quxiaoguanzhu).click()
        sleep(2)
        self.loc_ele(self.sandian2).click()
        sleep(2)
